﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace M
{
    public class Validation
    {
        public static bool IsValidInt(string str)
        {
            try
            {
                int n = int.Parse(str);
                return true;
            }
            catch (Exception)
            {

                return false;
            }
        }

        public static bool IsValidDecimal(string str)
        {
            try
            {
                decimal n = decimal.Parse(str);
                return true;
            }
            catch (Exception)
            {

                return false;
            }
        }

        public static bool IsValidDateTime(string str)
        {
            try
            {
                DateTime n = DateTime.Parse(str);
                return true;
            }
            catch (Exception)
            {

                return false;
            }
        }

        public static bool IsValidDouble(string str)
        {
            try
            {
                double n = double.Parse(str);
                return true;
            }
            catch (Exception)
            {

                return false;
            }
        }
    }
}